<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title><{$goodsdetail[goodsname]}></title>
     <script type='text/javascript' src='__PUBLIC__/home/js/jquery.js'></script>
    <meta name="Keywords" content="书">
    <link href="__PUBLIC__/home/css/public.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/product_detail.css" rel="stylesheet" type="text/css">
    <link href="__PUBLIC__/home/css/yiguo.css" rel="stylesheet" type="text/css">

    <script src="__PUBLIC__/home/js/jquery_002.js"></script>
    <script src="__PUBLIC__/home/js/base.js"></script>
</head>
<body id="body">

    <div class="w w1280">
        <div id="topads">
            </div>
        <!--页头-->
        <include file="./Public/header.html" />

<div class="header-nav">
    <div class="wrap">
        <!--商品分类 开始-->
        <div class="catalogs">
            <div class="catalogs-title"><a href="javascript:;">全部商品分类▼</a></div>
            <div class="catalogs-list" id="_categry" style="display:none;">
                <!-- 遍历顶级分类 -->
                <foreach name="type" item="cats">
                    <div class="item">
                        <h3 class="t01_channelhome"><a href="__MODULE__/Goodslist/index/catsid/<{$cats.catsid}>"><i></i><{$cats.catsname}><s>&gt;</s></a></h3>
                        <div class="sub-item">
                            <h4><a href="__MODULE__/Goodslist/index/catsid/<{$cats.catsid}>"><{$cats.catsname}></a></h4>
                            <div class="sub-list">
                                <!--遍历子分类-->
                                <foreach name="cats['subcat']" item="cat">
                                    <a href="__MODULE__/Goodslist/index/soncatsid/<{$cat.catsid}>/catsname/<{$cat.catsname}>" target="_self"><{$cat.catsname}></a>
                                </foreach>
                            </div>
                            <div class="catalogs-ad">
                                <a href="__MODULE__/Goodslist/index/catsid/$cats['catsid']"><img style="width:215px;" src="__ROOT__/public/home/imgs/yangguang.jpg" alt="$cats['catsname']"></a>
                            </div>
                        </div>
                    </div>
                </foreach>
                <!-- 分类结束 -->

            </div>
        </div>
        <!--商品分类 结束-->

        </div>
    </div>
</div>

<div class="wrap">
    <!--面包屑-->
    <div class="crumbs">
        <{$here}>
    </div>
    <!--产品详情-->
    <div class="content clearfix">
        <div class="product-intro clearfix j_product">
            <!--预览图-->
            <div class="pic-preview">
                <div class="pic-big">
                    <img class="j_product_img" src="__PUBLIC__/Upload/<{$goodsdetail.goodspic}>" style="display:  block;" height="500" width="500">
                    <img class="j_product_img" src="__PUBLIC__/Upload/<{$goodsdetail.goodspic}>" style="display: none;" height="500" width="500">
                    <img class="j_product_img" src="__PUBLIC__/Upload/<{$goodsdetail.goodspic}>" style="display: none;" height="500" width="500">
                </div>
                <div class="pic-thumb">
                    <div class="picList">
                        <ul>
                            <li><img src="__PUBLIC__/Upload/<{$goodsdetail.goodspic}>" height="85" width="85"></li>
                            <li><img src="__PUBLIC__/Upload/<{$goodsdetail.goodspic}>" height="85" width="85"></li>
                            <li><img src="__PUBLIC__/Upload/<{$goodsdetail.goodspic}>" height="85" width="85"></li>
                        </ul>
                    </div>
                </div>

            </div>
            <div class="product-info">
                <div class="summary-name">
                    <h1>&nbsp;<{$goodsdetail.goodsname}></h1>
                    <p></p> 
                    <input name="CommodityId" id="CommodityId" value="" type="hidden">
                </div>
                <div class="summary-price clearfix">
                    <div class="pro-price">
                        <div>
                            <span>价格：</span>
                            <span><em>¥</em><strong>
                            <{$goodsdetail.price}>
                            </strong></span>
                        </div>
                            <div class="mt5">
                                <span>原价：</span>
                                <span><del>¥<{$goodsdetail.oldprice}>/册</del></span>
                            </div>
                    </div>
                    <div class="pro-review">
                        <p>总体满意度</p>
                        <p><b>4.2</b> 分</p>
                        <p><a href="#comment" id="pllabel"><span></span></a></p>
                    </div>
                </div>
                <div class="summary-other clearfix">
                    <div class="left">
<div class="pro-promo clearfix" style="margin-bottom: 20px; padding-bottom: 10px; border-bottom: 1px dashed rgb(217, 217, 217);">
    <ul>
    </ul>
</div>

                        <div class="pro-service">满百包邮，<b>20:00</b> 前完成订单，预计后天<b></b>送达</div>
                        <div class="pro-amount clearfix">
                            <div class="dt">数量：</div>
                            <div class="dd">
                                <if condition="$goodsdetail.store == 0">
                                    <div maxlength="2" class="spinner value">
                                        <button class="decrease">-</button>
                                        <input value="0" class="spinner value"  maxlength="2" type="text" disabled>
                                        <button class="increase">+</button>
                                    </div>
                                    <else />
                                    <div maxlength="2" class="spinner value">
                                        <button class="decrease" onclick="func()">-</button>
                                        <input value="1" class="spinner value" id="number" maxlength="2" type="text" disabled>
                                        <button class="increase" onclick="fun()">+</button>
                                    </div>

                                </if>

                              

                            <div class="addcart" id='a'>
                                <if condition="$goodsdetail.store == 0">

                                        <a class="btn-gn"  href="#" ><i></i>暂时无货</a>
                                    <else />
                                        <if condition="$V=SESSION('username')">
                                        <a class="btn-gn" href="javascript:;" onclick="addCart(<{$goodsdetail.goodsid}>)"><i></i>加入购物车</a>
                                        <else/>
                                            <a class="btn-gn" href="javascript:;" onclick="alert('请登录')"><i></i>加入购物车</a>
                                        </if>
                                </if>
                            </div>
                            </div>
                              <script type="text/javascript">
                                function fun(){
                                    var num=document.getElementById('number');
                                    num.value ++; 
                                    if(num.value >= <{$goodsdetail.store}>){
                                        num.value = <{$goodsdetail.store}>;
                                    }
                                     //console.log(a.href);
                                }

                                function func(){
                                    var num=document.getElementById('number');
                                    num.value --;
                                    if(num.value <= 1){
                                        num.value = 1;
                                    }
                                }

                                
                                </script>

                        </div>
                        <div class="pro-share clearfix">
                            <div class="favorite"><a href="__MODULE__/collect/add/goodsid/<{$goodsdetail.goodsid}>" onclick="G.app.cart.module.addToFavor('67ef74af-36e9-4f71-b724-71992fdf7e07',1)"><i></i>收藏</a></div>
                        </div>

                        
                    </div>
                    <div class="right">
                        <table class="zx" width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tbody style="font-size:11px">
                                <tr style="color:grey;"><th>商品编号：</th><td><{$goodsdetail.goodsNo}></td></tr>
                                <tr><th style="color:grey;">商品状态：</th><td><font color="2CA6E0">
                                <if condition="$goodsdetail.store == 0">
                                    缺货
                                    <else />
                                    有货
                                </if>
                                </font></td></tr>
                                <tr style="color:grey;"><th>库存：</th><td><{$goodsdetail.store}></td></tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="content clearfix">
        <!--左侧-->
        <div class="left-con">

            <div class="box recommend">
                <div class="hd">猜你喜欢</div>
                <div class="bd">
                    <foreach name='go' item='go'>
                        <div class="p j_product">
                            <div class="img">
                                <a href="__MODULE__/Goodsdetail/index/goodsid/<{$go.goodsid}>" target="_blank">
                                        <img src="__PUBLIC__/Upload/<{$go.goodspic}>" class="j_product_img" height="68" width="68">

                                </a>
                            </div>
                            <div class="txt">
                                <a href="#" target="_blank">
                                    <strong><{$go.goodsname}></strong>
                                    <span>¥<{$go.price}></span>
                                </a>
                            </div>
                        </div>
                    </foreach>

                </div>
            </div>

        </div>
        <!--右侧-->
        <div class="main-con">
            <!--当季热卖-->


    <div class="hot-sale">
        <div class="hd">当季热卖</div>
        <div class="bd clearfix">
            <ul>
            <foreach name='new' item='new'>
                    <li>
                        <div class="p-img">
                            <a href="__MODULE__/Goodsdetail/index/goodsid/<{$new.goodsid}>" target="_blank">
                               <img src="__PUBLIC__/Upload/<{$new.goodspic}>" height="135" width="135">
                            </a>
                        </div>
                        <div class="p-name"><a href="#" target="_blank"><{$new.goodsname}></a></div>
                        <div class="p-price">
                            <strong>¥<{$new.price}></strong>
                        </div>
                    </li>
                </foreach>
            </ul>
        </div>
    </div>

            <!--商品详情-->
            <div class="product-detail" >
                <div class="detail-tab">
                    <ul class="detail-ul" id='li'>
                        <li data='0' style='cursor:pointer'><a>商品详情</a></li>
                        <li data='1' style='cursor:pointer'><a>用户评价<b></b></a></li>
                    </ul>

                </div>
                <div class="detail-content">

                    <!--商品详情================================================================================-->
                    <div class="detail-item details clearfix" id="details">
                    <{$goodsdetail.description}>
                    </div>


                    <!--用户评价==================================================================================-->
                     
                       <div class="detail-item" id="comment">
                        <div class="comment-info clearfix">
                            <div class="score">总体满意度<b>4.3<span>分</span></b></div>
                            <div class="percent">
                                <ul class="slip">
                                    <li><b>好评</b><span w="89%" style="width: 89%;"></span><i>89%</i></li>
                                    <li><b>中评</b><span w="11%" style="width: 11%;"></span><i>11%</i></li>
                                    <li><b>差评</b><span w="0%" style="width: 0%;"></span><i>0%</i></li>
                                </ul>
                            </div>
                            <div class="comment-btn">
                                <p>只有购买过该商品的用户才能评价</p>
                            </div>
                        </div>
                        <div class="comment-list clearfix">

                            <div id="ProductCommentVote">
                                <div _votetype="0">
 <foreach name='comment' item='comment'>
<div class="comment-con" style="display:block;">
        <ul>
                <li>
                    <div class="comment-item" _voteid="3dd8cc32-e0a4-45d7-8ae8-cd7266ebaf55" _userid="93f3a1d4-f323-462e-97ec-959637e7a77f">
                        <div class="user">
                            <img src="__ROOT__/public/home/imgs/nophoto.gif" width="60" height="60">
                            <span class="name"><{$comment.user_name}></span>
                            <span class="level">普通用户</span>
                        </div>
                        <div class="content-comment">
                            <div class="heading">

                                 
                                 <div class="date">评价时间:<{$comment.commenttime}></div>
                            </div>

                            <div class="reply">
                                <{$comment.content}>
                                <br>
                                <div class="reply-images">

                                </div>
                                <div class="reply-image-big"><img src="" width="500" height="500"></div>
                            </div>
                            <if condition="$comment.rcon != null">
                            <span style='color:red'>回复:</span>
                            <br><span>回复时间:<{$comment.rtime}></span>
                                <div class="reply">
                                  <{$comment.rcon}>
                                <br>

                            </div>
                            </if>
                        </div>
                    </div>

                </li>


        </ul>

        
</div>
</foreach>
</div>

                            </div>
                        </div>

                    </div>
                
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        $('.detail-content>div').css('display','block').eq(1).css('display','none');

        $('#li>li').click(function(){      
          var num=$(this).attr("data");
        $('.detail-content>div').css('display','none').eq(num).css('display','block');
            
        })

    });

    //加入购物车
    function addCart(id){
        //获取商品的数量，赋值给变量m
        var m = $("#number").val();
        $.ajax({
            //定义url
            url:"__MODULE__/Cart/ajax",
            //数据的提交方式
            type:"post",
            //返回数据的格式
            dataType:"json",
            //需要提交的数据
            data:{'id':id,'m':m},
            //提交成功后对返回数据进行判断
            success:function(data){
                if(data==0){
                    alert("添加失败");
                    return false;
                }else{
                    alert("添加成功");
                }
            }
        });
        return true;
    }
</script>



    <!------- 页尾 ------>
    <include file="./Public/footer.html" />


        <!------- 侧边悬浮 ------->
        <div class="sidebar" id="sidebar">
            <a href="#body" class="s-btn goTop"></a>
            
        </div>


</body>
</html>